
<!DOCTYPE HTML>
<html>
<head>
<title>河马网站管理后台</title>
<link href="css/login.css" rel="stylesheet" type="text/css" media="all"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<script src="../js/jquery.js"></script>
<script src="../js/vali.js"></script>
</head>
<body>
<div class="login">
	<h2><img src="images/admin_logo.png"></h2>
	<div class="login-top">
		<h1>账户登陆</h1>
		<form action="/login/login.json" method="post" class="account_login_form" autocomplete="off" id="form_post_once">
			<div class="Rcheck">
			  <input type="text"  datatype="/[0-9A-Za-z]{6,25}/"   nullmsg="请输入用户名"   errormsg="用户名长度6-25个以内的字母<br/>数字或者两者的结合"  maxlength="11" autocomplete="off" placeholder="请输入用户名" >
			   <input type="text" datatype="/^[\w]{6,25}$/" nullmsg="请输入密码" errormsg="密码应为6-25位字母<br/>数字或者下划线" maxlength="25"  onfocus="this.type='password'" autocomplete="off" placeholder="请输入密码">
			</div>
			<div class="forgot">
				<a type="submit"  class="vali_btn" style="background:#32989e; height:40px; border-radius: 10px; color:#fff;display:inline-block; padding:0 30px;border-right:0; line-height:40px; font-size:16px" >登陆</a>
			</div>
		</form>
	</div>
	<div class="login-bottom">
	
	</div>
</div>
<script src="../layui.js"></script> 
<script src="../js/fun.js"></script>
<script>
var ajaxSending=false
 $("#form_post_once").Verification({
            vali_btn: ".vali_btn",
            ajaxpost: true,
            ignoreHidden: true,
            showAllError: false,
            onError: function(o, txt) {
                ErrorTishi(o, txt)
            },
            onSuccess: function(o) {
                ValiSuccess(o)
            },
            onCallback: function(o) {
                var fun = $(o).attr("AddFun")
                if (typeof(fun) != "undefined") {
                    eval(fun)
                }
            },
            beforeSubmit: function(e) {
                var url = $("#form_post_once").attr("action");
                if (ajaxSending) {
                    return;
                }
                ajaxSending = true;
                $.ajax({
                    url: url,
                    data: $("#form_post_once").serialize(),
                    type: "POST",
                    dataType: 'json',
                   success: function(data) {
						if (data.rescode == 0) {
							KZ.form.Prompt(data.resmsg, 1);
							setTimeout(function() { window.location.href = data.jumpUrl }, 1000)
						} else {
							KZ.form.Prompt(data.resmsg, 1);
						}
						ajaxSending = false;
					},
					error: function(er) {
						BackErr(er);
						ajaxSending = false;
					}
                });
               
            }
        })
</script>
</body>
</html>